<HTML>
<HEAD>
<TITLE>DefaultProjectName - CButton</TITLE>
<script type="text/javascript">
  var relPathToCommmon = "../../common/";
  var relPathToHelpDir = "../../common/help/";
</script>
<script type="text/javascript" src="../../common/jsdyn.js" language="JavaScript"></script>
<script type="text/javascript" src="../../common/js.js" language="JavaScript"></script>
<script type="text/javascript" src="leftmenu.js" language="JavaScript"></script>
<script type="text/javascript">
  var toSearchPage     = "_search','../../search";
  Body1();
</script>
<div class="headerPage">CButton</div>
<div class="path"><a href="#" OnMouseOver="link('','../../index',this)" class="pathLink">OOXlib</A><img src="../../common/path-arrow.gif" class="path-arrow"><a href="#" OnMouseOver="link('_dir','include0',this)" class="pathLink">include</A><img src="../../common/path-arrow.gif" class="path-arrow"><a href="#" OnMouseOver="link('_class','CButton4032',this)" class="pathLink">CButton</A><img src="../../common/path-arrow.gif" class="path-arrow"><span class="pathNonLink">CButton</span></div>
<script type="text/javascript">
 Body2();
 BodyLeftMenuStart();
WriteLeftMenu("","","","");
 BodyLeftMenuEnd();
 Body3();
</script>
<span class="tabInActive"><a href="#" OnMouseOver="linkTab('_member','CButton2238913480','_description',this)" class="tabLinkInActive">Description</a></span>
<span class="tabActive"><a href="#" OnMouseOver="linkTab('_member','CButton2238913480','_source',this)" class="tabLinkActive">Source</a></span>
<span class="tabInActive"><a href="#" OnMouseOver="linkTab('_member','CButton2238913480','_callgraph',this)" class="tabLinkInActive">Call Graph</a></span>
<script type="text/javascript">
 Body4();
</script>
<div class="contentAirTop"></div>
<div class="paragraph2NoTopPadding">Start Line: 59</div>
<pre class="codeExamples">
 <a href="#" onMouseOver="link('_member','CButton2238913480',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CButton<BR>(const CXServerConnection * pXServerConnection, const CScreen * pScreen, IWindow * pParentWindow, const CUInt2dRectangle & Rectangle, const IEventHandler * pEventHandler, const ::std::string & ButtonText, const CColor * pBackgroundColor, const CColor * pTextColor, const unsigned int iHorizontalOffset, const unsigned int iVerticalOffset)',CAPTION,'<strong>Brief description</strong><BR>Constructor.');" onMouseOut="return nd();">OOXlib::CButton::CButton</a>(const CXServerConnection *pXServerConnection, const CScreen *pScreen, IWindow *pParentWindow, const CUInt2dRectangle &amp;Rectangle, const IEventHandler *pEventHandler, const::std::string &amp;ButtonText, const CColor *pBackgroundColor, const CColor *pTextColor, const unsigned int iHorizontalOffset, const unsigned int iVerticalOffset)
: <a href="#" onMouseOver="link('_member','CSimpleWindow1572908937',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CSimpleWindow&nbsp;&nbsp;(const CXServerConnection * pXServerConnection, const CScreen * pScreen)',CAPTION,'<strong>Brief description</strong><BR>Constructor.');" onMouseOut="return nd();">CSimpleWindow</a>(pXServerConnection, pScreen, pParentWindow, Rectangle, NoEventMask, NULL, ::std::string(), "Button", ::std::string(), pBackgroundColor, 0, false, true),
<a href="#" onMouseOver="link('_member','m_pGC3760068007',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CGraphicsContext *&nbsp;&nbsp;m_pGC ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_pGC</a>(NULL), <a href="#" onMouseOver="link('_member','m_Text3760068007',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>::std::string&nbsp;&nbsp;m_Text ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_Text</a>(ButtonText), <a href="#" onMouseOver="link('_member','m_pTextColor3760068007',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>CColor *&nbsp;&nbsp;m_pTextColor ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_pTextColor</a>(pTextColor), <a href="#" onMouseOver="link('_member','m_iHorizontalOffset3760068007',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>unsigned int&nbsp;&nbsp;m_iHorizontalOffset ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_iHorizontalOffset</a>(iHorizontalOffset), <a href="#" onMouseOver="link('_member','m_iVerticalOffset3760068007',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>unsigned int&nbsp;&nbsp;m_iVerticalOffset ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_iVerticalOffset</a>(iVerticalOffset), <a href="#" onMouseOver="link('_member','m_bIsButtonPressed3760068007',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>bool&nbsp;&nbsp;m_bIsButtonPressed ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_bIsButtonPressed</a>(false), <a href="#" onMouseOver="link('_member','m_bIsMouseOver3760068007',this); overLibDiagram();return overlib('<strong>Syntax</strong><BR>bool&nbsp;&nbsp;m_bIsMouseOver ',CAPTION,'<strong>Brief description</strong><BR>');" onMouseOut="return nd();">m_bIsMouseOver</a>(false) {
    // Create the graphics context.
    m_pGC = new CGraphicsContext(m_pXServerConnection, this);
    // Set text and compute the text rectangle.
    m_pGC-&gt;SetText(m_Text);
    m_Rectangle = m_pGC-&gt;ComputeTextRectangle();
    unsigned int parentWidth = static_cast&lt;unsigned int&gt;(m_pParentWindow-&gt;GetSize().GetX());
    unsigned int parentHeight = static_cast&lt;unsigned int&gt;(m_pParentWindow-&gt;GetSize().GetY());
    unsigned int rectangleWidth = m_Rectangle.GetWidth() + 2 * m_iHorizontalOffset;
    unsigned int rectangleHeight = m_Rectangle.GetHeight() + 2 * m_iVerticalOffset;
    // Cmpute the rectangle position
    unsigned int rectanglePosX = 0;
    unsigned int rectanglePosY = 0;
    if(rectangleWidth &lt; parentWidth) {
        rectanglePosX = Rectangle.GetPositionX();
    }
    if(rectangleHeight &lt; parentHeight) {
        rectanglePosY = Rectangle.GetPositionY();
    }
    // Set the new recatngle.
    m_Rectangle.Set(rectanglePosX, rectanglePosY, rectangleWidth, rectangleHeight);
    delete m_pGC;
    // Destroy window.
    Destroy();
    // Create new window.
    Create(pScreen, pParentWindow, m_Rectangle, ExposureMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask  | SubstructureNotifyMask, pEventHandler, ::std::string(), "Button",
           ::std::string(), pBackgroundColor, 0, false, true);
    // Create graphics context.
    m_pGC = new CGraphicsContext(m_pXServerConnection, this);
    // Set text.
    m_pGC-&gt;SetText(m_Text);
}
</pre><div class="contentAirBottom"></div>
<script type="text/javascript">
 Body5();
Statistics("","","","","");
 Body6();
SetPageTab('_member','_source');
</script>
